package com.yvon.service.demo.spring.beans.factory;

import com.yvon.service.demo.spring.beans.BeansException;

/**
 * bean工厂
 * 定义获取Bean的接口
 *
 * @author Yvon
 * @since 2022-11-24
 */
public interface BeanFactory {

    /**
     * 根据名称获取Bean
     *
     * @param name
     * @return {@code Object }
     */
    Object getBean(String name) throws BeansException;

    /**
     * 根据名称获取Bean
     *
     * @param name 名字
     * @param args arg游戏
     * @return {@code Object }
     */
    Object getBean(String name, Object... args) throws BeansException;

    /**
     * 根据名称和类型获取Bean
     *
     * @param name
     * @param requiredType
     * @return {@code T }
     */
    <T> T getBean(String name, Class<T> requiredType);
}
